<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="embed/template.xhtml">
                
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <ui:define name="topnav">
            <ui:include src="/embed/menu.xhtml">
                <ui:param name="page" value="home" />
            </ui:include>
   </ui:define> 

    <ui:define name="sidebar">
       <!--  <ui:include src="/login/login.xhtml" />-->
   </ui:define>
   <ui:define name="search">   
       <ui:include src="/embed/search.xhtml" />
    </ui:define> 
   <ui:define name="body"> 
        
      <f:subview id="sentInfo" rendered="#{addresses.rowAvailable}">                
       <rich:panel>   	
		<f:facet name="header">您已经选择的配送地址</f:facet>
		<h:form>         
			    <h:dataTable value="#{addresses}" var="item">
                    <h:column>
						<div class="formRow"><h:outputLabel>收货人姓名：</h:outputLabel>
						<h:outputText value="#{item.signName}" /></div>

						<div class="formRow"><h:outputLabel for="province">省份/直辖市：</h:outputLabel>
						<h:outputText value="#{item.province}" /></div>


						<div class="formRow"><h:outputLabel for="address">详细地址：</h:outputLabel>
						<h:outputText value="#{item.detailAddress}" /></div>

						<div class="formRow"><h:outputLabel for="zipcode">邮政编码：</h:outputLabel>
						<h:outputText value="#{item.zipcode}" /></div>
						<div class="formRow"><h:outputLabel for="telephone">手机号码：</h:outputLabel>
						<h:outputText value="#{item.telephone}" /></div>	
					 	 <h:commandButton action="sentStyle" value="配送至这个地址" style=" width : 113px;"/>  
					</h:column>
			      </h:dataTable>
			     <br/>				    
		     </h:form>
           </rich:panel> 
        </f:subview>
         <br/>
           <rich:panel>  
			<f:facet name="header">请输入新的配送地址</f:facet>
			<h:form styleClass="register">
				<s:validateAll>
					<div class="formRow"><h:outputLabel for="username">收货人姓名<em>*</em>
					</h:outputLabel> 
					<h:inputText id="username" value="#{newAddress.signName}"
						required="true" />
					<h:outputText>由字母，数字，下滑线组成，须以字母开头，6-10位</h:outputText> 
					<div class="validationError"><h:message for="username" /></div>
					</div>

					<div class="formRow"><h:outputLabel for="province">省份/直辖市<em>*</em>
					</h:outputLabel> <h:selectOneMenu id="province"
						value="#{AddressInfo.honorific}">
						<s:selectItems value="#{AddressInfohonorifics}" var="honorific"
							label="#{honorific.label}" />
						<s:convertEnum />
					</h:selectOneMenu></div>

                    
					<div class="formRow"><h:outputLabel for="address">详细地址<em>*</em>
					</h:outputLabel> <h:inputText id="address" value="#{newAddress.detailAddress}" required="true"
						styleClass="wide" />
						<h:outputText>300个城市送货上门</h:outputText> 
					<div class="validationError"><h:message for="address" /></div>
					</div>

                    <div class="formRow"><h:outputLabel for="zipcode">邮政编码<em>*</em>
					</h:outputLabel> <h:inputText id="zipcode" value="#{newAddress.zipcode}" required="true"
						styleClass="wide" />
						<h:outputText>六位邮政编码</h:outputText> 
					<div class="validationError"><h:message for="zipcode" /></div>
					</div>         

　　　　　　　　　　　　　 <div class="formRow"><h:outputLabel for="telephone">手机号码<em>*</em>
					</h:outputLabel> <h:inputText id="telephone" value="#{newAddress.telephone}" required="true"
						styleClass="wide" />
						<h:outputText>请输入手机号</h:outputText> 
					<div class="validationError"><h:message for="telephone" /></div>
					</div>					
		 		</s:validateAll>                
                <h:commandButton action="sentStyle" value="配送至这个地址"/>														
			</h:form>
		</rich:panel>
		
	</ui:define>
</ui:composition>

